import { defineStore } from 'pinia'
export interface Account {
  accountId: number
  enabled: boolean
  lastLoginTime: Date | null
  nickname: string | null
  password?: string | null
  username: string | null
}
export const accountStore = defineStore('account', {
  state: () => ({
    // 全局响应式变量
    // count: 0
    account: {} as Account,
    token: '' as string | null
  }),
  //   getters: {
  //     doubleCount: (state) => state.count * 2
  //   },
  //   actions: {
  //     allIncrement() {
  //       this.count++
  //     }
  //   }
  persist: {
    storage: sessionStorage,
    paths: ['account','token']
  }
})
